package com.woniu.cloud.api;


import com.woniu.cloud.common.dto.Result;
import com.woniu.cloud.form.StoreServiceMiddleInsertForm;
import com.woniu.cloud.form.TStoreServiceUpdateMiddle;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**

 *
 * @author Lucas
 * @since 2021-09-22
 */
@FeignClient(value = "store",contextId = "StoreServiceMiddleApi")
public interface StoreServiceMiddleApi {

    /***
     * 添加服务
     * @param storeServiceMiddleInsertForm 店铺服务添加信息
     * @return true false
     */
    @PostMapping("insertStoreServiceMiddle")
    Result insertStoreServiceMiddle(
            @RequestBody StoreServiceMiddleInsertForm storeServiceMiddleInsertForm);


    /***
     * 通过店铺id查看服务
     * @param storeId 店铺服务表店铺ID
     * @return data为该店铺所有的服务list
     */
    @GetMapping("getStoreServiceMiddleListByStoreId")
    public Result getStoreServiceMiddleListByStoreId(@RequestParam("storeId")Integer storeId);


    /***
     * 下架服务
     * @param storeServiceMiddleId 店铺服务表ID
     * @param storeServiceMiddleStatus 0：下架   1：上架
     * @return data为success/fail
     */
    @PutMapping("updateStoreServiceMiddleStatusByStoreServiceMiddleId")
    Result updateStoreServiceMiddleStatusByStoreServiceMiddleId(
            @RequestParam("storeServiceMiddleId")Integer storeServiceMiddleId,
            @RequestParam("storeServiceMiddleStatus")Integer storeServiceMiddleStatus);

    /***
     * 修改服务
     * @param storeServiceUpdateMiddle 修改信息
     * @return data为success/fail
     */
    @PutMapping("updateStoreServiceMiddleById")
    Result updateStoreServiceMiddleById(
            @RequestBody TStoreServiceUpdateMiddle storeServiceUpdateMiddle);

    /***
     * 通过店铺id查看服务
     * @param id id
     * @return data为该店铺所有的服务list
     */
    @GetMapping("getStoreServiceMiddleById")
    Result getStoreServiceMiddleById(
            @RequestParam("id") Integer id);

}